package org.cainiao.io.nio.buffer;

import java.nio.CharBuffer;

public class BufferSlick {

    public static void main(String[] args) {
        CharBuffer buffer = CharBuffer.allocate(8);
        buffer.position(3).limit(5);
        CharBuffer sliceBuffer = buffer.slice();

        System.out.printf("buffer.position() = %d\n", buffer.position());

        System.out.printf("sliceBuffer.position() = %d\n", sliceBuffer.position());
        System.out.printf("sliceBuffer.arrayOffset() = %d\n", sliceBuffer.arrayOffset());
    }
}
